package com.methods;

/**
 * 家用车类
 * 2017/8/16
 * @author Erik
 * @version 0.1
 * @since JDK1.8.
 */
public final class HomeCar extends Car {
    private int num;

    public HomeCar(){}
    public HomeCar(String color,String userName,int num){
        super(color,userName);
        this.setNum(num);
    }

    //setters

    public void setNum(int num) {   this.num = num; }
    //getters
    public int getNum() {   return this.num;    }

    public void display(){
        System.out.println(this.getUserName()+"拥有的"+this.getColor()+"颜色的私家车有"+this.getNum()+"座位");
    }

    public void display(int num){
        System.out.println("家用汽车"+this.getNum()+"个座位");
    }
}
